package org.openquark.cal_Cal_Collections_Set;
import org.openquark.cal.internal.runtime.lecc.RTData;
import org.openquark.cal.internal.runtime.lecc.RTExecutionContext;
import org.openquark.cal.internal.runtime.lecc.RTPartialApp;
import org.openquark.cal.internal.runtime.lecc.RTResultFunction;
import org.openquark.cal.internal.runtime.lecc.RTSupercombinator;
import org.openquark.cal.internal.runtime.lecc.RTValue;
import org.openquark.cal.runtime.CALExecutorException;
import org.openquark.cal_Cal_Core_Prelude.Const__;
public final class Difference extends RTSupercombinator {
/*
* CAL data instances for literal values.
*/
private static final RTData.CAL_Int $L1_Int_0 = RTData.CAL_Int.make(0);
private static final RTData.CAL_Int $L2_Int_2 = RTData.CAL_Int.make(2);
/**
* Singleton instance of this class.
*/
public static final Difference $instance = new Difference();
/*
* Data constructor class instances for all referenced data constructors.
*/
private static final TYPE_Set.CAL_Tip i_Tip = TYPE_Set.CAL_Tip.make();
private Difference() {
}
public final int getArity() {
return 3;
}
public final java.lang.String getModuleName() {
return "Cal.Collections.Set";
}
public final java.lang.String getUnqualifiedName() {
return "difference";
}
public final java.lang.String getQualifiedName() {
return "Cal.Collections.Set.difference";
}
/**
* f
* This method implements the function logic of the CAL function Cal.Collections.Set.difference
*/
public final RTValue f(final RTResultFunction $rootNode, final RTExecutionContext $ec) throws CALExecutorException {
// Arguments
RTValue t2 = $rootNode.getArgValue();
RTValue $currentRootNode;
RTValue t1 = ($currentRootNode = $rootNode.prevArg()).getArgValue();
RTValue $dictvarCal_Core_Prelude_Ord_19 =
$currentRootNode.prevArg().getArgValue();
// Release the fields in the root node to open them to garbage collection
$rootNode.clearMembers();
return
f3S(
RTValue.lastRef(
$dictvarCal_Core_Prelude_Ord_19,
$dictvarCal_Core_Prelude_Ord_19 = null),
RTValue.lastRef(t1.evaluate($ec), t1 = null),
RTValue.lastRef(t2.evaluate($ec), t2 = null),
$ec);
}
/**
* f3L
* This method implements the function logic of the CAL function Cal.Collections.Set.difference
*/
public final RTValue f3L(RTValue $dictvarCal_Core_Prelude_Ord_19, RTValue t1, RTValue t2, RTExecutionContext $ec) throws CALExecutorException {
return
f3S(
RTValue.lastRef(
$dictvarCal_Core_Prelude_Ord_19,
$dictvarCal_Core_Prelude_Ord_19 = null),
RTValue.lastRef(t1.evaluate($ec), t1 = null),
RTValue.lastRef(t2.evaluate($ec), t2 = null),
$ec);
}
/**
* f3S
* This method implements the function logic of the CAL function Cal.Collections.Set.difference
*/
public final RTValue f3S(RTValue $dictvarCal_Core_Prelude_Ord_19, RTValue t1, RTValue t2, RTExecutionContext $ec) throws CALExecutorException {
// Top level supercombinator logic
if (Is_Empty.$instance.fUnboxed1S(t1.getValue(), $ec)) {
return Difference.i_Tip;
} else {
if (Is_Empty.$instance.fUnboxed1S(t2.getValue(), $ec)) {
return t1.getValue();
} else {
return
Hedge_Diff.$instance.f5S(
$dictvarCal_Core_Prelude_Ord_19,
new RTPartialApp._2._1(
Const__.$instance,
Difference.$L1_Int_0),
new RTPartialApp._2._1(
Const__.$instance,
Difference.$L2_Int_2),
t1.getValue(),
t2.getValue(),
$ec);
}
}
}
}